home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 52 / Amiga Format AFCD52 (Issue 136, May 2000).iso / -serious- / workbench / convert35icon / install < prev    next >
Text File  |  2000-02-28  |  6KB  |  250 lines

  1. ; $VER: Installation script for Convert35Icon 1.0 (14. Luty 2000)
  2. ; © Rafal Mania 'Manius'
  3. ; Created with GoldED 6.2
  4.  
  5. ; check if we are running under correct OS
  6.  
  7. (if (< (/ (getversion) 65536) 40)
  8.  
  9.     (
  10.         (abort "Incorrect OS version (software requires OS 40 or better )!")
  11.     )
  12. )
  13.  
  14.  
  15. ; error handling
  16.  
  17. (onerror
  18.  
  19.     (if (> @ioerr 0)
  20.  
  21.         (
  22.             (message
  23.  
  24.                 ("An error has occurred during installation. Please check the log file to understand the error.")
  25.             )
  26.         )
  27.     )
  28.  
  29.     (exit (quiet))
  30. )
  31.  
  32. (set sourcePath (expandpath (pathonly @icon)))
  33.  
  34. (set #installmode
  35.  
  36.     (askbool
  37.  
  38.         (prompt "Choose the installation mode:")
  39.  
  40.         (help (cat "\nYou may here choose if You want install/remove ")
  41.                    " supplied package.\n")
  42.  
  43.         (choices
  44.  
  45.             "Install"
  46.             "Uninstall"
  47.         )
  48.  
  49.         (default 1)
  50.     )
  51. )
  52.  
  53. (if (= #installmode 1)
  54.  
  55.     ; normal installation
  56.  
  57.     (
  58.         (welcome)
  59.  
  60.         ; --- insert your code below ---
  61.  
  62.  
  63.         (set #os31
  64.  
  65.             (askbool
  66.  
  67.                 (prompt "Do You want OS3.1 version installed?")
  68.  
  69.                 (help (cat "\nThere is a special version of Convert35Icon for OS3.1 "
  70.                        "which doesn't need OS3.5 installed.\n\nInstead "
  71.                        "only icon.library V44+ is needed (not included).\n\n"
  72.                        "The OS3.5 version has more features then OS3.1 version, "
  73.                        "but it NEEDS OS3.5")
  74.                 )
  75.  
  76.                 (choices
  77.  
  78.                     "Yes"
  79.                     "No"
  80.                 )
  81.  
  82.                 (default 2)
  83.             )
  84.         )
  85.         (if (= #os31 1)
  86.                                       
  87.             (
  88.               (run
  89.                    (cat (tackon sourcepath "gpatch ")
  90.                         (tackon sourcepath "Convert35Icon ")
  91.                         (tackon sourcepath "patches.ptg ")
  92.                         "T:Convert35Icon_OS31"
  93.                    )
  94.  
  95.                    (prompt "Now patching the Convert35Icon executable")
  96.  
  97.                    (help (cat "\nIf You want to use Convert35Icon on OS3.1 machine,"
  98.                               " original Convert35Icon has to be patched." )
  99.                    )
  100.  
  101.                    (confirm)
  102.               )
  103.  
  104.  
  105.               (copyfiles
  106.  
  107.                   (prompt "Copying OS3.1 version of Convert35Icon")
  108.  
  109.                   (source "T:Convert35Icon_OS31")
  110.  
  111.                   (dest (expandpath "C:"))
  112.  
  113.                   (newname "Convert35Icon")
  114.  
  115.                   (confirm)
  116.  
  117.                   (optional "fail")
  118.  
  119.                   (help (cat"\nThe patched version of Convert35Icon will be"
  120.                              " copied to specified destination.")
  121.                   )
  122.               )
  123.  
  124.               (set #iconlib
  125.  
  126.                   (askfile
  127.                     
  128.                       (prompt "Choose icon.library V44+ to patch")
  129.  
  130.                       (help (cat"\nAs the OS3.1 version of Convert35Icon needs"
  131.                                 " some function from OS3.5 icon.library,"
  132.                                 " the original one has to be patched.\n"
  133.                                 "Only three versions are supported:\n"
  134.                                 "Original OS3.5 distribution (44616 bytes)\n"
  135.                                 "BoingBag1 update (44804 bytes)\n"
  136.                                 "DirectoryOpus 5.82 update (44808 bytes)")
  137.                       )
  138.  
  139.                       (default "RAM:")
  140.                   )
  141.               )
  142.  
  143.               (working "Now patching selected library")
  144.  
  145.               (run
  146.                    (cat (tackon sourcepath "gpatch ")
  147.                         (cat #iconlib " ")
  148.                         (tackon sourcepath "patches.ptg ")
  149.                         "T:ic35.library"
  150.                    )
  151.  
  152.                    (prompt "The OS3.5 icon.library will be patched now")
  153.  
  154.                    (help "The patching programm will be started now\n")
  155.  
  156.                    (confirm)
  157.               )
  158.               
  159.               (copylib
  160.  
  161.                   (prompt "Now copy the patched icon.library")
  162.  
  163.                   (source "T:ic35.library")
  164.  
  165.                   (dest (expandpath "LIBS:"))
  166.  
  167.                   (confirm)
  168.  
  169.                   (newname "ic35.library")
  170.  
  171.                   (optional "fail")
  172.  
  173.                   (help (cat"\nThe patched icon.library HAS to be"
  174.                             " copied to LIBS: assign as ic35.library."
  175.                         )
  176.                   )
  177.               )
  178.  
  179.  
  180.             )
  181.  
  182.             ; else
  183.  
  184.             (
  185.              (copyfiles
  186.  
  187.                 (prompt "Now copying the OS3.5 version of Convert35Icon")
  188.  
  189.                 (source "Convert35Icon")
  190.  
  191.                 (dest (expandpath "C:"))
  192.  
  193.                 (confirm)
  194.  
  195.                 (optional "fail")
  196.  
  197.                 (help (cat"\nThe OS3.5 version of Convert35Icon will be copied"
  198.                           " to specified destination.")
  199.                 )
  200.             )
  201.  
  202.  
  203.  
  204.             )
  205.         )
  206.  
  207.  
  208.  
  209.         ; --- end of your code ---
  210.  
  211.         (exit)
  212.     )
  213.  
  214.     ; uninstall application
  215.  
  216.     (
  217.         (welcome)
  218.         ; --- insert your code below ---
  219.  
  220.         (delete "LIBS:ic35.library"
  221.  
  222.              (prompt "Deleting ic35.library")
  223.         
  224.              (confirm)
  225.              
  226.              (optional "force")
  227.         
  228.              (help "The patched icon.library will be removed.")
  229.         )
  230.  
  231.         (delete "C:Convert35Icon"
  232.  
  233.              (prompt "Deleting Convert35Icon")
  234.  
  235.              (confirm)
  236.  
  237.              (optional "force")
  238.  
  239.              (help "The Convert35Icon executable will be removed.")
  240.         )
  241.  
  242.         ; -- end of your code ---
  243.  
  244.         (message "Uninstallation completed.")
  245.  
  246.         (exit (quiet))
  247.     )
  248. )
  249.  
  250.